home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSCOPY.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.6 KB  |  118 lines

  1.  /*=======================================================================*/
  2.  /*                                                                       */
  3.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  4.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  5.  /*                       Schaumburg, Illinois 60173                      */
  6.  /*                          All Rights Reserved                          */
  7.  /*                           InstallShield (R)                           */
  8.  /*                                                                       */
  9.  /*   File    : sdscopy.rul                                               */
  10.  /*                                                                       */
  11.  /*   Purpose : This file contains the code for the SdStartCopy           */
  12.  /*             script dialog function.                                   */
  13.  /*                                                                       */
  14.  /*-------------------------------------------------------------------------
  15.  
  16.  /*------------------------------------------------------------------------*/
  17.  /*                                                                        */
  18.  /*   Function: SdStartCopy                                                */
  19.  /*                                                                        */
  20.  /*   Descrip:  This dialog will infom the user about the data they have   */
  21.  /*             selected and allow them a last chance to modify their      */
  22.  /*             settings.                                                  */
  23.  /*   Misc:                                                                */
  24.  /*                                                                        */
  25.  /*------------------------------------------------------------------------*/
  26. function SdStartCopy( szTitle, szMsg, listData )
  27.           STRING  szDlg, szTemp;
  28.           INT     nId, list;
  29.           BOOL    bDone;
  30.           HWND    hwndChild, hwndDlg;
  31.         begin
  32.  
  33.           szDlg     = SD_DLG_STARTCOPY;
  34.           nSdDialog = SD_NDLG_STARTCOPY;
  35.  
  36.           // record data produced by this dialog
  37.           if (MODE=SILENTMODE) then
  38.             SdMakeName( szAppKey, szDlg, szTitle, nSdStartCopy );
  39.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  40.             return nId;
  41.           endif;
  42.  
  43.           // ensure general initialization is complete
  44.           if (!bSdInit) then
  45.              SdInit();
  46.           endif;
  47.  
  48.           if (EzDefineDialog( szDlg, "", "", SD_NDLG_STARTCOPY) = DLG_ERR) then
  49.              return -1;
  50.           endif;
  51.  
  52.           // Loop in dialog until the user selects a standard button
  53.           bDone = FALSE;
  54.  
  55.           while (!bDone)
  56.  
  57.              nId = WaitOnDialog( szDlg );
  58.  
  59.              switch (nId)
  60.              case DLG_INIT:
  61.                   if(szMsg != "") then
  62.                       SdSetStatic( szDlg, SD_STA_MSG1, szMsg );
  63.                   endif;
  64.  
  65.                   hwndDlg = CmdGetHwndDlg( szDlg );
  66.                   SdGeneralInit( szDlg, hwndDlg, 0, szSdProduct );
  67.  
  68.                   if(szTitle != "") then
  69.                       SetWindowText( hwndDlg, szTitle );
  70.                   endif;
  71.  
  72.                   if (listData = 0) then
  73.                      hwndChild = GetDlgItem( hwndDlg, SD_MULTEDIT_FIELD1 );
  74.                      ShowWindow( hwndChild, SW_HIDE );
  75.                      hwndChild = GetDlgItem( hwndDlg, SD_STA_SETTINGS );
  76.                      ShowWindow( hwndChild, SW_HIDE );
  77.                   else
  78.                      CtrlSetMLEText( szDlg, SD_MULTEDIT_FIELD1, listData );
  79.                   endif;
  80.  
  81.              case SD_PBUT_CONTINUE:
  82.                   nId   = NEXT;
  83.                   bDone = TRUE;
  84.  
  85.              case BACK:
  86.                   nId    = BACK;
  87.                   bDone  = TRUE;
  88.  
  89.              case DLG_ERR:
  90.                   SdError( -1, szDlg );
  91.                   nId   = -1;
  92.                   bDone = TRUE;
  93.  
  94.              case DLG_CLOSE:
  95.                   SdCloseDlg( hwndDlg, nId, bDone );
  96.  
  97.              default:
  98.                   // check standard handling
  99.                   if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  100.                       bDone = TRUE;
  101.                   endif;
  102.              endswitch;
  103.  
  104.           endwhile;
  105.  
  106.           EndDialog( szDlg );
  107.           ReleaseDialog( szDlg );
  108.  
  109.           SdUnInit();
  110.  
  111.           // record data produced by this dialog
  112.           SdMakeName( szAppKey, szDlg, szTitle, nSdStartCopy );
  113.           SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  114.  
  115.           return nId;
  116.         end;
  117.  
  118.